<?php
class Cms_Bootstrap extends Zend_Application_Module_Bootstrap
{
    protected function _initCmsTranslate(){
        $admin_translate_path = APPLICATION_PATH."/modules/cms/languages/";
        $adminDefaultLang = H_G::AD_DEFAULT_LANG;
        try{            
                $adminTranslate = @new H_Translate(array(
                        'adapter' => 'array',
                        'content' => $admin_translate_path.$adminDefaultLang.".php",
                        'locale'  => $adminDefaultLang
                ));
                
                $files = scandir($admin_translate_path);
                foreach ($files as $file){
                    if (is_file($admin_translate_path.$file)){
                        if ($file != $adminDefaultLang.'.php'){                            
                            $lang = str_replace(".php", "", $file);
                            $adminTranslate->addTranslation(array(
                                'content' => $admin_translate_path.$file,
                                'locale'  => $lang
                            ));
                        }
                    }
                }

        }catch(Zend_Translate_Exception $e){
            H_E::printDie("Translate Error");
        }
        
        @$adminTranslate->setLocale($adminDefaultLang);
        Zend_Registry::set(H_G::T_AD_TRANSLATE, $adminTranslate);
    }    
}

